package com.ruoyi.web.controller.system;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson2.JSON;
import com.ruoyi.web.apimodel.system.artistlog.ArtistEditLogSearch;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.ArtistEditLog;
import com.ruoyi.system.service.IArtistEditLogService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 艺人修改记录Controller
 * 
 * @author Yaphets
 * @date 2024-07-05
 */

@Api(tags = "艺人修改记录")
@RestController
@RequestMapping("/system/artistEditLog")
public class ArtistEditLogController extends BaseController
{
    @Autowired
    private IArtistEditLogService artistEditLogService;

    /**
     * 查询艺人修改记录列表
     */
    @ApiOperation(value = "查询艺人修改记录列表")
    @ApiResponse(code = 200, message = "success", response = TableDataInfo.class)
//    @PreAuthorize("@ss.hasPermi('system:artistEditLog:list')")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody ArtistEditLogSearch artistEditLogSearch)
    {
        startPage(artistEditLogSearch);
        ArtistEditLog artistEditLog = JSON.parseObject(JSON.toJSONString(artistEditLogSearch), ArtistEditLog.class);
        List<ArtistEditLog> list = artistEditLogService.selectArtistEditLogList(artistEditLog);
        return getDataTable(list);
    }

//    /**
//     * 导出艺人修改记录列表
//     *
//     */
//    @PreAuthorize("@ss.hasPermi('system:artistEditLog:export')")
//    @Log(title = "艺人修改记录", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, ArtistEditLog artistEditLog)
//    {
//        List<ArtistEditLog> list = artistEditLogService.selectArtistEditLogList(artistEditLog);
//        ExcelUtil<ArtistEditLog> util = new ExcelUtil<ArtistEditLog>(ArtistEditLog.class);
//        util.exportExcel(response, list, "艺人修改记录数据");
//    }
//
//    /**
//     * 获取艺人修改记录详细信息
//     */
//    @PreAuthorize("@ss.hasPermi('system:artistEditLog:query')")
//    @GetMapping(value = "/{id}")
//    public AjaxResult getInfo(@PathVariable("id") Long id)
//    {
//        return success(artistEditLogService.selectArtistEditLogById(id));
//    }
//
//    /**
//     * 新增艺人修改记录
//     */
//    @PreAuthorize("@ss.hasPermi('system:artistEditLog:add')")
//    @Log(title = "艺人修改记录", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody ArtistEditLog artistEditLog)
//    {
//        return toAjax(artistEditLogService.insertArtistEditLog(artistEditLog));
//    }
//
//    /**
//     * 修改艺人修改记录
//     */
//    @PreAuthorize("@ss.hasPermi('system:artistEditLog:edit')")
//    @Log(title = "艺人修改记录", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(@RequestBody ArtistEditLog artistEditLog)
//    {
//        return toAjax(artistEditLogService.updateArtistEditLog(artistEditLog));
//    }
//
//    /**
//     * 删除艺人修改记录
//     */
//    @PreAuthorize("@ss.hasPermi('system:artistEditLog:remove')")
//    @Log(title = "艺人修改记录", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{ids}")
//    public AjaxResult remove(@PathVariable Long[] ids)
//    {
//        return toAjax(artistEditLogService.deleteArtistEditLogByIds(ids));
//    }
}
